import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EtchedBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Created by Scott Tiger.
 * User: tomaszsocha
 * Date: 2010-05-05
 * Time: 13:27:36
 */
public class Klata extends JApplet{
    RootPaneContainer mRPC;
    Polaczenia p;

    public Klata() {
        mRPC = this;
    }

    public Klata(JFrame frame) { 
        mRPC = frame;
    }

    public void init() {
        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        panel.setToolTipText("Crafter ver: 0.2  ");
        p = new Polaczenia();

        LaczenieItem armor = new LaczenieItem("Armor",false);


        JPanel panel_koszulki = new LaczenieZk(armor,false,p);

     // pBronie.add(range);


        JTabbedPane dndTab = new JTabbedPane();
        dndTab.setName("D'n'D");
        JPanel dnd = new LaczenieDnD(armor,false,p);
        dnd.setName("Koszulki");


        panel_koszulki.setName(armor.getName());


        JTabbedPane tabbedPane = new JTabbedPane();


        tabbedPane.add(armor);
        tabbedPane.add(dnd);
        final DrawingArea drawingArea = new DrawingArea();
        panel.add(drawingArea, BorderLayout.CENTER);
        panel.add(tabbedPane);

        panel.setSize(800,600);
        mRPC.setContentPane(panel);


    }


     public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setTitle("Crafter ver: 0.2");
        final Klata app = new Klata(frame);

        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                app.stop();
                app.destroy();
                System.exit(0);
            }
        });

        app.init();

        frame.setSize(800, 600);
        frame.setVisible(true);

        app.start();
    }

     public void start() {
    }

    // The stop method is the place to stop the execution of the applet.
    // This is where you would tell an animation to stop running.
    public void stop() {
    }

    // The destroy method is where you would do any final cleanup that needs to be done.  The
    // destroy method is rarely required, since most of the cleanup can usually be done in stop().
    public void destroy() {
    }




}



